var SecretarioMapper = require('../mappers/secretario.mapper'),
    Secretario = require('../classes/secretario');

//FIXME
function SecretarioController() {
    var mapper = new SecretarioMapper();

    this.add = function(req) {
        var s = new Secretario();
        s.setNome(req.body.nome);
        s.setEmail(req.body.email);
        s.setUsername(req.body.username);
        s.setPassword(req.body.password);
        s.setMatricula(req.body.matricula);
        s.setTelefone(req.body.matricula);
        s.setRoles(['manager']);
        mapper.add(s);
    }

    this.get = function(req, callback) {
        var s = new Secretario();
        s.setNome(req.body.nome);
        s.setEmail(req.body.email);
        s.setUsername(req.body.username);
        s.setPassword(req.body.password);
        s.setMatricula(req.body.matricula);
        s.setTelefone(req.body.matricula);
        mapper.get(s, function(err, s) {
            callback(err, s);
        });
    }

    this.update = function(req) {
        //TODO
    }

    this.remove = function(req) {
        //TODO
    }

}

module.exports = SecretarioController;
